import { defHttp } from '@/utils/http/axios'

enum Api {
  ADDSCENCE = '/scene/add',
  UPDATESCENE = '/scene/update',
  DELETESCENE = '/scene/delete',
  SCENCE_DETAIL = '/scene/detail',
  SCENCE_TREE = '/scene/tree',
  SCENCE_LIST = '/scene/list',
}

export const addScence = (data) => defHttp.post({ url: Api.ADDSCENCE, data })
export const updateScence = (data) => defHttp.post({ url: Api.UPDATESCENE, data })
export const deleteScence = (data) => defHttp.post({ url: Api.DELETESCENE, data })
export const getScenceDetail = (params) => defHttp.get({ url: Api.SCENCE_DETAIL, params })
export const getScenceTree = (sceneId?: string) =>
  defHttp.get({ url: Api.SCENCE_TREE, params: { sceneId } })
export const getScenceList = (sceneParentId?: string) =>
  defHttp.get({ url: Api.SCENCE_LIST, params: { sceneParentId } })
